package com.faner.fast.excel.kit;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.faner.fast.excel.annotation.ResponseExcel;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;


@ResponseExcel(name = "导入时错误信息", sheet = "错误信息")
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
//@ColumnWidth(value = 25)
//@HeadRowHeight(value = 20)
//@ContentRowHeight(value = 18)
public class ExcelRow implements Serializable {

    @ExcelIgnore
    private int rowNum;

    @ExcelProperty(value = "错误信息")
    private String validateMessage;

    public void setValidateMessage(String validateMessage) {
        this.validateMessage = StringUtils.isBlank(this.validateMessage) ? validateMessage
                : this.validateMessage + "\n" + validateMessage;
    }


}
